package cn.yuanqiao.cqbc.yqCarrierManage.service.impl;

import cn.yuanqiao.common.utils.SecurityUtils;
import cn.yuanqiao.cqbc.yqCarrierManage.domain.YqCarriermanageDetail;
import cn.yuanqiao.cqbc.yqCarrierManage.mapper.YqCarriermanageDetailMapper;
import cn.yuanqiao.cqbc.yqCarrierManage.service.YqCarriermanageDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 载体检测详情表 服务实现类
 * </p>
 *
 * @author lyk
 * @since 2022-11-21
 */
@Service
public class YqCarriermanageDetailServiceImpl implements YqCarriermanageDetailService {

    @Autowired
    private YqCarriermanageDetailMapper yqCarriermanageDetailMapper;


    /*public void add(YqCarriermanageDetail param){
        YqCarriermanageDetail entity = getEntity(param);
        this.save(entity);
    }

    @Override
    public void delete(YqCarriermanageDetail param){
        this.removeById(getKey(param));
    }

    @Override
    public void update(YqCarriermanageDetail param){
        YqCarriermanageDetail oldEntity = getOldEntity(param);
        YqCarriermanageDetail newEntity = getEntity(param);
        ToolUtil.copyProperties(newEntity, oldEntity);
        this.updateById(newEntity);
    }*/


    @Override
    public List<YqCarriermanageDetail> findPageBySpec(YqCarriermanageDetail param){
        String tenantCode = SecurityUtils.getTenantCode();
        param.setTenantCode(tenantCode);
        List<YqCarriermanageDetail> yqCarriermanageDetails = yqCarriermanageDetailMapper.customList(param);
        return yqCarriermanageDetails;
    }

    @Override
    public List<YqCarriermanageDetail> findPageByBatchId(YqCarriermanageDetail param){
        String tenantCode = SecurityUtils.getTenantCode();
        param.setTenantCode(tenantCode);
        return yqCarriermanageDetailMapper.customList(param);
    }

    @Override
    public int deleteByBatchId(YqCarriermanageDetail YqCarriermanageDetail) {
        String tenantCode = SecurityUtils.getTenantCode();
        return this.yqCarriermanageDetailMapper.deleteByBatchId(YqCarriermanageDetail.getBatchId(),tenantCode);
    }

    /*private Serializable getKey(YqCarriermanageDetail param){
        return param.getId();
    }

    private Page getPageContext() {
        return LayuiPageFactory.defaultPage();
    }

    private YqCarriermanageDetail getOldEntity(YqCarriermanageDetail param) {
        return this.getById(getKey(param));
    }

    private YqCarriermanageDetail getEntity(YqCarriermanageDetail param) {
        YqCarriermanageDetail entity = new YqCarriermanageDetail();
        ToolUtil.copyProperties(param, entity);
        return entity;
    }*/

}
